Skip to content

fix(tui): surface sub-agent provider errors in parent task flow#18444

Open
LucasSantana-Dev wants to merge 1 commit intoanomalyco:devfrom
LucasSantana-Dev:fix/subagent-rate-limit-warning-propagation
Open

fix(tui): surface sub-agent provider errors in parent task flow#18444
LucasSantana-Dev wants to merge 1 commit intoanomalyco:devfrom
LucasSantana-Dev:fix/subagent-rate-limit-warning-propagation

Conversation

@LucasSantana-Dev
Copy link
Copy Markdown

@LucasSantana-Dev LucasSantana-Dev commented Mar 20, 2026

Issue for this PR

Closes #17583

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This ensures sub-agent provider failures are visible in the parent task flow. The task tool previously returned normally even when the sub-agent ended with an assistant API error, which made the parent flow appear successful with no clear failure signal.

Now the task tool surfaces non-abort sub-agent assistant errors as tool failures (Sub-agent failed: ...). This makes rate-limit/provider failures visible in the primary flow instead of being silently swallowed.

How did you verify your code works?

  • cd packages/opencode && bun test test/tool/task.test.ts
  • cd packages/opencode && bun run typecheck
  • Added regression test for a mocked sub-agent 429/API error propagation path

Screenshots / recordings

Not a UI layout change. TUI behavior change validated by test coverage.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Related: #5204

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

I found some potentially related PRs:

Related PRs:

  1. PR fix: Fixes race conditions and missing error handling that cause subagents to hang indefinitely when errors occur. #18389 - "fix: Fixes race conditions and missing error handling that cause subagents to hang indefinitely when errors occur"

    • Appears to address similar subagent error handling issues in a recent PR
  2. PR fix(opencode): propagate subagent errors to parent session #13422 - "fix(opencode): propagate subagent errors to parent session"

  3. PR fix: robust subagent completion propagation #13321 - "fix: robust subagent completion propagation"

    • Also addresses subagent propagation concerns

Why they're related: These PRs all deal with error handling and propagation from sub-agents/subagents to parent tasks/sessions. PR #18444 specifically focuses on surfacing terminal provider/API errors from SessionPrompt.prompt() up the chain, which overlaps conceptually with these other error propagation fixes. PR #18389 in particular seems very recent and might warrant checking for overlap.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Rate Limit (429) / Provider Warning UI Feedback for Sub-Agents in TUI

1 participant